#include "SDLInput.h"

SDLInput* SDLInput::instance = 0;

SDLInput::SDLInput()
{
	memset(keys, false, sizeof(bool)*SDLK_END);
	memcpy(lastKeys, keys, sizeof(bool)*SDLK_END);
}

void SDLInput::Poll(SDL_Event e)
{
	switch (e.type)
	{
	case SDL_KEYDOWN:
		lastKeys[e.key.keysym.sym] = false;
		keys[e.key.keysym.sym] = true;
		break;
	case SDL_KEYUP:
		lastKeys[e.key.keysym.sym] = true;
		keys[e.key.keysym.sym] = false;
		break;
	default:
		break;
	}
}
